extends Control


func _on_嗜血狂战_pressed():
	ObjectManager.soundManager.play(SoundType.button_click)
	if !GameUtils.checkIsReadyAction() || !GameUtils.checkActionEnough(SpendData.COST_鼓舞_嗜血狂战):
		return
	ObjectManager.gameManager.operationManager.changeOperationType(OperationType.鼓舞_嗜血狂战)
	visible = false
	ObjectManager.gameManager.ui.closeDesc()


func _on_乘风破浪_pressed():
	ObjectManager.soundManager.play(SoundType.button_click)
	if !GameUtils.checkIsReadyAction() || !GameUtils.checkActionEnough(SpendData.COST_鼓舞_乘风破浪):
		return
	ObjectManager.gameManager.operationManager.changeOperationType(OperationType.鼓舞_乘风破浪)
	visible = false
	ObjectManager.gameManager.ui.closeDesc()


func _on_生生不息_pressed():
	ObjectManager.soundManager.play(SoundType.button_click)
	if !GameUtils.checkIsReadyAction() || !GameUtils.checkActionEnough(SpendData.COST_鼓舞_生生不息):
		return
	ObjectManager.gameManager.operationManager.changeOperationType(OperationType.鼓舞_生生不息)
	visible = false
	ObjectManager.gameManager.ui.closeDesc()


func _on_常胜将军_pressed():
	ObjectManager.soundManager.play(SoundType.button_click)
	if !GameUtils.checkIsReadyAction() || !GameUtils.checkActionEnough(SpendData.COST_鼓舞_常胜将军):
		return
	ObjectManager.gameManager.operationManager.changeOperationType(OperationType.鼓舞_常胜将军)
	visible = false
	ObjectManager.gameManager.ui.closeDesc()


func _on_嗜血狂战_mouse_entered():
	var ui = ObjectManager.gameManager.ui as UI
	ui.wantShowDesc("嗜血狂战：消耗2点能量，己方全部大子获得嗜血，嗜血：大子攻击成功后获得1点行能量")



func _on_乘风破浪_mouse_entered():
	var ui = ObjectManager.gameManager.ui as UI
	ui.wantShowDesc("乘风破浪：消耗2点能量，己方全部大子获得踏浪，踏浪：己方大子可以水中行走")



func _on_生生不息_mouse_entered():
	var ui = ObjectManager.gameManager.ui as UI
	ui.wantShowDesc("生生不息：消耗2点能量，己方全部大子获得旺育，旺育：出大消耗-1")



func _on_常胜将军_mouse_entered():
	var ui = ObjectManager.gameManager.ui as UI
	ui.wantShowDesc("常胜将军：消耗2点能量，己方全部大子获得常胜，常胜：己方大子攻击成功后获得护盾")



func _on_mouse_exited():
	var ui = ObjectManager.gameManager.ui as UI
	ui.closeDesc()
